'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};
//编码
modelField.Code = {
    type: String,
    default: '',
    trim: true,
    Name: '编码',
    IsUnique: true,
    IsEmpty: false
};
//名称
modelField.Name = {
    type: String,
    trim: true,
    Name: '名称',
    IsEmpty: false
};

//0: 数值  1: 字符串  2: 布尔  3: 选择
modelField.Type = {
    type: Number,
    default: 1
};
//可扩展枚举
modelField.ExtendEnum = {
    type: Schema.ObjectId,
    ref: 'ExtendEnum'
};
//单位
modelField.Unit = {
    type: String,
    trim: true
};
modelField.Remark = {
    type: String,
    default: '',
    trim: true
};

var newModel = new Model(modelField);
newModel.addIndex({Code: 1});
newModel.create('QCNorm', '质检指标');
